python requests
Requests: HTTP for Humans™ — Requests 2.20.1 documentation
使いやすい http request library
debugする時は、urllib3(多機能? http library) を logging.DEBUGにして、logを見るのが速いかも。
prepared_requestで、request オブジェクトもみられるけど、logをばっと出して見る方が速い。たぶん。
code: req.py
import logging
logging.getLogger("urllib3").setLevel(logging.DEBUG)
error(だった)
r = request.post(...)
で、r.request を見ると、 PreparedRequest GET となってる。
locustで、method not allowed (server)側で getと解釈されてる?
=> http -> httpsのredirectだった。
参考:
Python requests - print entire http request (raw)? - Stack Overflow